#include <iostream>
#include <memory>
#include <cstring>
#include "tcp_serve.hpp"

void usage(const std::string &cmd)
{
    std::cerr << "Usager: " << cmd << " port[1024+]\n";
}

int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        usage(argv[0]);
        exit(Use_error);
    }

    std::unique_ptr<tcp_serve> pts(new tcp_serve(atoi(argv[1])));
    pts->init();
    pts->start();
    return 0;
}